package com.gy.componit;

import com.gy.game.Game;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import java.awt.*;
import java.math.BigDecimal;

/**
 * 子弹
 * @author Dsy
 * @create 2022-02-04  1:56
 */
@Getter
@Setter
public abstract class Bullet implements Component{

    BigDecimal x,y;

    BigDecimal vx, vy;

    Team team;

    /*@Override
    public void paint(Graphics g) {

    }*/

    @Override
    public AreaPoint getAreaPoint(int areaSize) {
        return new AreaPoint(x.intValue()/areaSize, y.intValue()/areaSize);
    }

    @Override
    public void move(Game game) {
        x = x.add(vx);
        y = y.add(vy);
    }

    @Override
    public int getOrder() {
        return 0;
    }
}
